import React, { Suspense } from 'react'
import ReactDOM from 'react-dom/client'
import { BrowserRouter, HashRouter } from 'react-router-dom'
import Loading from './components/Loading'
import App from './App'
// Suspense 的作用: 在组件懒加载的时候,给用户提示一个正在加载的效果
ReactDOM.createRoot(document.getElementById('root')).render(
  <HashRouter>
    {/* fallback中要传入懒加载的时候要展示的内容 */}
    <Suspense fallback={<Loading />}>
      <App />
    </Suspense>
  </HashRouter>
)
